package com.milhouz.bomberrokon.engines;

import com.milhouz.bomberrokon.BomberSlashActivity;
import com.milhouz.bomberrokon.events.Event;

/**
 * Abstract classes for the Game Engines.<br>
 * It implements an Events queue to communicate between all engines.
 * 
 * @author bpetetot
 * 
 */
public abstract class Engine {

	/** The parent game activity */
	protected BomberSlashActivity mRokonActivity;

	// Engines
	/** Game Engine */
	protected GameEngine mGameEngine;
	/** Graphic Engine */
	protected GraphicEngine mGraphicEngine;
	/** Sound Engine */
	protected SoundEngine mSoundEngine;

	/** Engine constructor */
	public Engine(BomberSlashActivity rokonActivity) {
		mRokonActivity = rokonActivity;
	}

	/** create the engine */
	public abstract void createEngine();

	/** First Engine loading */
	public abstract void loadEngine();

	/** Engine work in a frame step */
	public abstract void step();

	/** Event treatment by the engine */
	public abstract void processEvent(Event event);

	/** Attach the game engine */
	public void attachGameEngine(GameEngine gameEngine) {
		mGameEngine = gameEngine;
	}

	/** Attach the graphic engine */
	public void attachGraphicEngine(GraphicEngine graphicEngine) {
		mGraphicEngine = graphicEngine;
	}

	/** Attach the sound engine */
	public void attachSoundEngine(SoundEngine soundEngine) {
		mSoundEngine = soundEngine;
	}

}
